package Thread_method_package;

public class MyThread extends Thread {
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName() + "@" + i);

            //表示出让当前CPU的执行权，不能保证不会再次抢到
            Thread.yield();
        }
    }
}
